﻿namespace Framework.Base{

    // 基础对象
    public class BaseObject{
        
        // 销毁对象
        public void Destroy(){
            if(!this.m_isDestroy){
                this.m_isDestroy = true;
                this.OnDestroy();
            }
        }

        public bool IsVailed()
        {
            return !m_isDestroy;
        }

        protected virtual void OnDestroy(){}

        // 是否被销毁了
        private bool m_isDestroy = false;
    }

}
